---
title: Agno Infra
sidebarTitle: "Agno Infra"
---

The Agno Infra library provides standardized codebases to help you take your AgentOS to production. It lets you define, deploy, and manage your entire Agentic System as Python code.

## Create a new Agno Infra project

Run `ag infra create` to create a new infra project, the command will ask your for a starter template and infra project name.

<CodeGroup>

```bash Create Infra Project
ag infra create
```

</CodeGroup>

And select a template from the list of available templates.

## Start infra resources

Run `ag infra up` to start i.e. create infra resources. This will start your AgentOS instance and PostgreSQL database locally using docker.

<CodeGroup>

```bash terminal
ag infra up
```

```bash shorthand
ag infra up dev:docker
```

```bash full options
ag infra up --env dev --infra docker
```

```bash short options
ag infra up -e dev -i docker
```

</CodeGroup>

## Stop infra resources

Run `ag infra down` to stop i.e. delete infra resources

<CodeGroup>

```bash terminal
ag infra down
```

```bash shorthand
ag infra down dev:docker
```

```bash full options
ag infra down --env dev --infra docker
```

```bash short options
ag infra down -e dev -i docker
```

</CodeGroup>

## Patch infra resources

Run `ag infra patch` to patch i.e. update infra resources

<CodeGroup>

```bash terminal
ag infra patch
```

```bash shorthand
ag infra patch dev:docker
```

```bash full options
ag infra patch --env dev --infra docker
```

```bash short options
ag infra patch -e dev -i docker
```

</CodeGroup>

<br />

<Note>

The `patch` command in under development for some resources. Use `restart` if needed

</Note>

## Restart infra

Run `ag infra restart` to stop resources and start them again

<CodeGroup>

```bash terminal
ag infra restart
```

```bash shorthand
ag infra restart dev:docker
```

```bash full options
ag infra restart --env dev --infra docker
```

```bash short options
ag infra restart -e dev -i docker
```

</CodeGroup>

## Command Options

<Note>Run `ag infra up --help` to view all options</Note>

### Environment (`--env`)

Use the `--env` or `-e` flag to filter the environment (dev/prd)

<CodeGroup>

```bash flag
ag infra up --env dev
```

```bash shorthand
ag infra up dev
```

```bash short options
ag infra up -e dev
```

</CodeGroup>

### Infra (`--infra`)

Use the `--infra` or `-i` flag to filter the infra (docker/aws/k8s)

<CodeGroup>

```bash flag
ag infra up --infra docker
```

```bash shorthand
ag infra up :docker
```

```bash short options
ag infra up -i docker
```

</CodeGroup>

### Group (`--group`)

Use the `--group` or `-g` flag to filter by resource group.

<CodeGroup>

```bash flag
ag infra up --group app
```

```bash full options
ag infra up \
  --env dev \
  --infra docker \
  --group app
```

```bash shorthand
ag infra up dev:docker:app
```

```bash short options
ag infra up \
  -e dev \
  -i docker \
  -g app
```

</CodeGroup>

### Name (`--name`)

Use the `--name` or `-n` flag to filter by resource name

<CodeGroup>

```bash flag
ag infra up --name app
```

```bash full options
ag infra up \
  --env dev \
  --infra docker \
  --name app
```

```bash shorthand
ag infra up dev:docker::app
```

```bash short options
ag infra up \
  -e dev \
  -i docker \
  -n app
```

</CodeGroup>

### Type (`--type`)

Use the `--type` or `-t` flag to filter by resource type.

<CodeGroup>

```bash flag
ag infra up --type container
```

```bash full options
ag infra up \
  --env dev \
  --infra docker \
  --type container
```

```bash shorthand
ag infra up dev:docker:app::container
```

```bash short options
ag infra up \
  -e dev \
  -i docker \
  -t container
```

</CodeGroup>

### Dry Run (`--dry-run`)

The `--dry-run` or `-dr` flag can be used to **dry-run** the command. `ag infra up -dr` will only print resources, not create them.

<CodeGroup>

```bash flag
ag infra up --dry-run
```

```bash full options
ag infra up \
  --env dev \
  --infra docker \
  --dry-run
```

```bash shorthand
ag infra up dev:docker -dr
```

```bash short options
ag infra up \
  -e dev \
  -i docker \
  -dr
```

</CodeGroup>

### Show Debug logs (`--debug`)

Use the `--debug` or `-d` flag to show debug logs.

<CodeGroup>

```bash flag
ag infra up -d
```

```bash full options
ag infra up \
  --env dev \
  --infra docker \
  -d
```

```bash shorthand
ag infra up dev:docker -d
```

```bash short options
ag infra up \
  -e dev \
  -i docker \
  -d
```

</CodeGroup>

### Force recreate images & containers (`-f`)

Use the `--force` or `-f` flag to force recreate images & containers

<CodeGroup>

```bash flag
ag infra up -f
```

```bash full options
ag infra up \
  --env dev \
  --infra docker \
  -f
```

```bash shorthand
ag infra up dev:docker -f
```

```bash short options
ag infra up \
  -e dev \
  -i docker \
  -f
```

</CodeGroup>
